package com.th.apicenter.jd;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Logger;

@EnableScheduling //开启定时任务
@Component
@Slf4j
public class JDTasks {


    private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");




//    @Scheduled(cron = "0 */10 * * * ?")
//    public void task() {
//
//        log.info("任务执行，当前时间：{}", dateFormat.format(new Date()));
//    }

//    // 每天凌晨1点执行
//    @Scheduled(cron = "0 0 1 * * ?")
//    public void dailyTask() {
//        log.info("执行每日任务");
//    }


}
